package com.yunc.modules.sys.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yunc.common.utils.R;
import com.yunc.modules.sys.entity.SysDept;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

public interface ISysDeptService extends IService<SysDept> {

    @Cacheable(value = "sysDeptAll", key = "#root.targetClass")
    List<SysDept> queryDeptList(SysDept sysDept);

    String selectMaxCode(Long parentId);

    /**
     * 保存
     */
    @CacheEvict(value = "sysDeptAll", key = "#root.targetClass")
    R saveDept(SysDept dept);

    /**
     * 更新
     */
    @CacheEvict(value = "sysDeptAll", key = "#root.targetClass")
    R updateDept(SysDept dept);
}
